package com.dk.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.dk.pojo.TbCollection;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface TbCollectionMapper extends BaseMapper<TbCollection> {

    @Select("select c.* from tb_collection c left join tb_cars car on car.id=c.cid where c.uid = #{uid} and c.cid = #{cid}")
    TbCollection selectAllByUidAndMid(@Param("uid") Long uid, @Param("cid") Long cid);

    @Insert("insert into tb_collection (cid,uid) VALUES (#{cid},#{uid})")
    void addCollection(Long cid, Long uid);
}
